﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Data.Linq;

namespace ElectronicCommerce.Framework.Data.Log
{
    public class LinqToSqlFileLogWriter : TextWriter
    {
        private DataContext context;

        public LinqToSqlFileLogWriter(DataContext context)
        {
            this.context = context;
        }

        public override void Write(string value)
        {
            return;
        }

        public override void Write(char[] buffer, int index, int count)
        {
            if (buffer == null || index < 0 || count < 0 || buffer.Length - index < count)
            {
                base.Write(buffer, index, count);
            }
            Write(new string(buffer, index, count));
        }

        public override System.Text.Encoding Encoding
        {
            get
            {
                return System.Text.Encoding.UTF8;
            }
        }
    }
}
